local ItemData = require("bag.Proto").ItemData
local FuWen = require("bag.Proto").FuWen
local FuwenSkillInfo = require("bag.Proto").FuwenSkillInfo
local Attr = require("role.Proto").Attr

RefineDesc = {
    {"desc",1,"string"}
}

RefineFuwenList = {
	{"fuwen",      1,   ItemData}, 
	{"pos",      1,   "byte"}, 
	{"heroID",      1,   "int"}, 
	{"heroIndex",      1,   "int"}, 
}

-- 符文背包列表（注意这里会分包）
GC_FUWEN_BAG_LIST = {
	{"list",      30,   ItemData}, 

}


-- 符文背包改变
GC_FUWEN_BAG_CHANGE = {
	{"itemID",     1,	"int"},
	{"itemIndex",  1,	"short"},
	{"itemData",   2,   ItemData},  -- 只有新增/更改的时候长度为1 删除时长度为0
}

-- 穿符文
CG_FUWEN_PUTON = {
	{"heroID",			1,		"int"},     -- 英雄id
	{"heroIndex",		1,		"short"},   -- 英雄index
	{"pos",		        1,		"byte"},    -- 符文部位
	{"fuwenIndex",		1,		"short"},   -- 符文背包中的index
}

GC_FUWEN_PUTON = {
	{"heroID",			1,		"int"},     -- 英雄id
	{"heroIndex",		1,		"short"},   -- 英雄index
	{"pos",		        1,		"byte"},    -- 符文部位
	{"fuwen",			1,		ItemData},  -- 符文
}

-- 脱符文
CG_FUWEN_PUTOFF = {
	{"heroID",			1,		"int"},   -- 英雄id
	{"heroIndex",		1,		"short"}, -- 英雄index
	{"pos",				1,		"byte"},  -- 装备部位
}


GC_FUWEN_PUTOFF = {
	{"heroID",			1,		"int"},   -- 英雄id
	{"heroIndex",		1,		"short"}, -- 英雄index
	{"pos",				1,		"byte"}, 
}

-- 合成
CG_FUWEN_SMELT_VAL_QUERY = {
}

GC_FUWEN_SMELT_VAL_QUERY = {
	{"accountSmeltVal", 1,      "short"},  -- 总熔炼值
}

CG_FUWEN_HECHENG_QUERY = {
    {"fuwenID",         1,      "int"},
    {"fuwenCnt",        1,      "byte"},
}

GC_FUWEN_HECHENG_QUERY = {
    {"successRate",     1,      "byte"},           -- 成功率
    {"costJinbi",       1,      "int"},              -- 消耗
    {"newFuwen",        1,      ItemData},            -- 合成符文
    {"smeltVal",        1,      "short"},              -- 失败获得熔炼值
	{"accountSmeltVal", 1,      "short"},  -- 总熔炼值
    {"desc1",           1,      "string"},               -- 新符文属性描述
    {"desc2",           1,      "string"},               -- 新符文技能描述
	{"base_attrs",       10,      Attr},  --符文基础属性
    {"percent_attrs",    10,      Attr},  --符文百分比属性
}

CG_FUWEN_HECHENG = {
    {"fuwenIndexList",  5,      "int"},                  -- 材料符文index
}

GC_FUWEN_HECHENG_SUCCESS = {
	{"fuwen",			1,		ItemData},  -- 合成符文成功获得符文
}

GC_FUWEN_HECHENG_FAIL = {
	{"accountSmeltVal",			1,		"short"},   -- 总熔炼值
    {"smeltVal",                1,      "short"},   -- 合成符文失败获得熔炼值
    {"fuwenJinghua",        1,      ItemData},          -- 合成符文失败获得符文精华
}

-- 分解
CG_FUWEN_FENJIE = {
    {"fuwenID",     1,  "int"},                      -- 要分解的符文ID
    {"fuwenIndex",  1,  "short"},                    -- 要分解的符文索引
}

GC_FUWEN_FENJIE = {
}
-- 兑换
CG_FUWEN_EXCHANGE_QUERY = {
}
GC_FUWEN_EXCHANGE_QUERY = {
    {"fuwen",       1,  ItemData},                             -- 符文
}
CG_FUWEN_EXCHANGE = {
}

GC_FUWEN_EXCHANGE = {
    {"fuwen",       1,  ItemData},                             -- 符文
}

-- 符文刷新查询
CG_FUWEN_REFRESH_QUERY = {
    {"fuwenID",     1,      "int"},                            -- 符文
    {"fuwenIndex",  1,      "short"},                            -- 符文背包index
    {"pos",         1,      "byte"},                            -- 符文装备位置
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

GC_FUWEN_REFRESH_QUERY = {
    {"fuwen",       1,  FuWen},                             -- 符文
    {"fuwenTemp",   1,  FuWen},                             -- 符文
    {"expend",      5,  ItemData},                      -- 消耗
    {"refreshCnt",  1,  "byte"},                            -- 重铸次数
    {"needCnt",     1,  "byte"},                            -- 幸运重铸所需次数
}

-- 执行符文刷新
CG_FUWEN_REFRESH_DO = {
    {"fuwenID",     1,  "int"},                              -- 符文id
    {"fuwenIndex",  1,  "short"},                            -- 符文index
    {"heroID",      1,  "int"},                              -- 英雄id
    {"heroIndex",   1,  "short"},                            -- 英雄索引
    {"pos",         1,  "byte"},                             -- 部位
}

GC_FUWEN_REFRESH_DO = {
    {"fuwen",       1,  ItemData},                               -- 符文
}

-- 符文 技能查询
CG_FUWEN_RARE_SKILL_QUERY = {
    {"type",    1,  "byte"},                                  -- 技能级别       1 初级 2 中级 3 高级
}

-- 符文刷新 保存
CG_FUWEN_REFRESH_SAVE = {
    {"fuwenID",     1,      "int"},                            -- 符文
    {"fuwenIndex",  1,      "short"},                            -- 符文背包index
    {"pos",         1,      "byte"},                            -- 符文装备位置
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

-- 发送技能信息
GC_FUWEN_RARE_SKILL_QUERY = {
    {"skillInfo",   50, FuwenSkillInfo},
    {"type",        1,"byte"},
}

-- 符文格子解锁
CG_FUWEN_UNLOCK_GRID = {
    {"pos",1,"byte"},                   -- 符文位
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

GC_FUWEN_UNLOCK_GRID = {
    {"result",1,"byte"},                -- 解锁结果
    {"pos",1,"byte"},                   -- 符文位
}

-- 符文属性 查询
CG_FUWEN_ATTR_QUERY = {
    {"fuwenID",     1,      "int"},                            -- 符文
    {"fuwenIndex",  1,      "short"},                            -- 符文背包index
    {"pos",         1,      "byte"},                            -- 符文装备位置
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

GC_FUWEN_ATTR_QUERY = {
    {"base_attrs",       10,      Attr},  --符文基础属性
    {"percent_attrs",    10,      Attr},  --符文百分比属性
}

-- 符文精炼预览
CG_FUWEN_REFINE_PREVIEW_QUERY = {
}

GC_FUWEN_REFINE_PREVIEW_QUERY = {
    {"fuwen",   1,  ItemData},              -- 预览符文
}

-- 符文精炼查询
CG_FUWEN_REFINE_QUERY = {
    {"fuwenID",     1,      "int"},                            -- 符文
    {"fuwenIndex",  1,      "short"},                            -- 符文背包index
    {"pos",         1,      "byte"},                            -- 符文装备位置
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

GC_FUWEN_REFINE_QUERY = {
    {"fuwen",1,ItemData},                          -- 符文
    {"expend",5,ItemData},                      -- 消耗
    {"refineDesc",5,RefineDesc},                       -- 精炼次数说明
}

-- 可精炼符文列表查询
CG_FUWEN_REFINE_LIST_QUERY = {}

-- 玩家所有符文列表
GC_FUWEN_ALL_LIST = {
	{"list",      30,   RefineFuwenList},
    {"isEnd",       1,  "byte"},
}

-- 符文精炼
CG_FUWEN_REFINE_DO = {
    {"fuwenID",     1,      "int"},                            -- 符文
    {"fuwenIndex",  1,      "short"},                            -- 符文背包index
    {"pos",         1,      "byte"},                            -- 符文装备位置
    {"heroID",      1,      "int"},                            -- 英雄id
    {"heroIndex",   1,      "short"},                            -- 英雄索引
}

GC_FUWEN_REFINE_DO = {
    {"fuwen",     1,      ItemData},                            -- 符文
}


-- 兵书相关
BingShuNet = {
    {"index",           1,      "byte"},           -- 兵书index 1-2
    {"skill",           1,      FuwenSkillInfo},
}
-- 兵书界面查询
CG_BINGSHU_QUERY = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
}
GC_BINGSHU_QUERY = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"skills",          3,      BingShuNet},        -- 已学习的兵书列表 
    {"openList",        3,      "byte"},            -- 开启条件列表 需要x星以上
    {"red",             3,      "byte"},            -- 红点
}


-- 兵书可选择/学习列表
BingShuLearnNet = {
    {"skill",           1,      FuwenSkillInfo},    -- 技能信息
    {"items",           3,      ItemData},          -- 学习消耗道具   
}
CG_BINGSHU_LEARN_LIST = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},    
    {"index",           1,      "byte"},           -- 兵书index 1-3
}
GC_BINGSHU_LEARN_LIST = {
    {"index",           1,      "byte"},           -- 兵书index 1-3
    {"list",            50,     BingShuLearnNet},
}

-- 学习
CG_BINGSHU_LEARN = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"index",           1,      "byte"},           -- 兵书index 1-3
    {"skillID",         1,      "int"},
}
GC_BINGSHU_LEARN = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"data",            1,      BingShuNet},
}

-- 升级查询
CG_BINGSHU_LEVELUP_QUERY = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"index",           1,      "byte"},       
}
GC_BINGSHU_LEVELUP_QUERY = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"bingshu",         1,      BingShuNet},
    {"upData",          2,      BingShuLearnNet},   -- 升级信息 长度为0表示满级
    {"forgetCost",      1,      "int"},             -- 遗忘消耗元宝
    {"returnItems",     3,      ItemData},          -- 遗忘返还道具
}

-- 升级
CG_BINGSHU_LEVELUP = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"index",           1,      "byte"},      
}
GC_BINGSHU_LEVELUP = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"bingshu",         1,      BingShuNet},    
}

-- 遗忘
CG_BINGSHU_FORGET = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"index",           1,      "byte"},           -- 兵书index 1-3    
}
GC_BINGSHU_FORGET = {
    {"heroID",          1,      "int"},
    {"heroIndex",       1,      "short"},
    {"index",           1,      "byte"},           -- 兵书index 1-3       
}

-- 符文获取途径查询
CG_FUWEN_GET_WAY_QUERY = {}

GC_FUWEN_GET_WAY_QUERY = {
    {"newFuwen",        1,      ItemData},            -- 合成符文
    {"desc1",           1,      "string"},               -- 新符文属性描述
    {"desc2",           1,      "string"},               -- 新符文技能描述
}